package com.nwpu.am.validation;

import com.nwpu.am.annotation.Probability;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * ProbabilityValidation
 *
 * @author Roy
 * @version 1.0
 * {@code @date} 2024/6/6
 */

public class ProbabilityValidation implements ConstraintValidator<Probability, Integer> {
    @Override
    public boolean isValid(Integer integer, ConstraintValidatorContext constraintValidatorContext) {
        return integer >= 0 && integer <= 100;
    }
}
